﻿using System.IO;

namespace Raven
{
    public class GraphNode
    {
        //every node has an index. A valid index is >= 0
        protected int _index;
        protected Vector2 _position;

        public int Index()
        {
            return _index;
        }

        public void SetPos(Vector2 newPosition)
        {
            _position = newPosition;
        }

        public Vector2 Pos()
        {
            return _position;
        }

        public GraphNode(BinaryReader reader)
        {
        }
    }

    public class NavGraphNode<T> : GraphNode
    {
        private T _extraInfo;

        public NavGraphNode(BinaryReader reader) : base(reader)
        {
            _index = reader.ReadInt32();

            _position.x = new Fix(reader.ReadInt32());
            _position.y = new Fix(reader.ReadInt32());
        }

        public T ExtraInfo()
        {
            return _extraInfo;
        }

        public void SetExtraInfo(T info)
        {
            _extraInfo = info;
        }
    }
}